<div class="center">
	<div class="home">
    	<div class="home_left">
        	<?php echo $this->partial('member/menu.phtml',array('uCount' => $this->uCount,'menuId'=>$this->menuId,'user'=>$this->user,'account'=>$this->account)); ?>
        </div>
    	<div class="home_right">
			<div class="replacerechargetop">
            	<i>支付宝充值码</i>
                <div class="replacerechargetname">
                	<h1>支付宝充值码</h1>
                    <p>身在海外无法对支付平台进行充值，悠奇代冲值服务为您解决烦恼。</p>
                </div>
            </div>
			<div class="replacerechargetab">
            	<ul>
                	<li><a class="tab1" href="/member/alipaycode"><i></i>购买充值码</a></li>
                	<li class="tabon"><a class="tab2" href="#"><i></i>我购买的充值码</a></li>
                </ul>
            </div>
            <div class="applyjilu">
            <?php if(count($this->cardOrder)>0)
                  {?>
            	<div class="applylist">
                    <table>
                        <tr>
                            <th class="j1">流水号</th>
                            <th class="j2">申请时间</th>
                            <th class="j3">充值金额(￥)</th>
                            <th class="j4">充值帐号</th>
                            <th class="j5">验证码</th>
                            <th class="j6">状态</th>
                            <th class="j7">操作</th>
                        </tr>
                        <?php 
                        	foreach($this->cardOrder as $item)
                        	{ 
                        		$class = "";
                        		if($item->state == "-1" || $item->state == "10")
                        		{
                        			$class = ' class="hui"';
                        		}
                       	?>
                        <tr<?php echo $class;?>>
                            <td class="j1"><?php echo $item->id; ?></td>
                            <td class="j2"><?php echo $item->createTime; ?></td>
                            <td class="j3"><?php echo number_format($item->money,2); ?></td>
                            <td class="j4"><?php echo $item->cardno; ?></td>
                            <td class="j5"><?php echo $item->verifyCode; ?></td>
                            <td class="j6">
                                                        
                            <?php 
                            $status_class = "";
                            $status_des = "";
                            switch($item->state)
                            {
                            	case '0':
                            		$status_class = 'class = "green"';
                            		$status_des = '未付款';
                            		break;
                            	case '5':
                            		$status_class = 'class = "qx"';
                            		$status_des = '受理中';
                            		break;
                            	case '10':
                            		$status_class = '';
                            		$status_des = '已付款';
                            		break;
                            	case '20':
                            		$status_class = 'class = "red"';
                            		$status_des = '待充值';
                            		break;
                                case '30':
                            		$status_class = 'class = "red"';
                            		$status_des = '充值完成';
                            		break;
                                 case '100':
                            		$status_class = 'class = "red"';
                            		$status_des = '已撤消';
                        	}?>
                            <span <?php echo $status_class;?>>
                            <?php echo $status_des;?>
                            </span>
                            <?php if($item->Status == '100')
                            {?>
                            	<div class="reason">
                                    <div class="yy"><a href="#"><i></i>失败原因</a></div>
                                    <div class="reasonts">
                                        <i></i>您提供的支付宝帐号是空号！
                                    </div>
                                </div>
                            <?php }?>
                            </td>
                            <td class="j7">

                            </td>
                        </tr>
                        <?php } ?>
                        
                        <!-- 
                        <tr>
                            <td class="j1">156151655</td>
                            <td class="j2">2012-12-12 12:25:23</td>
                            <td class="j3">100.00</td>
                            <td class="j4">
                                <p>支付宝</p>
                                kjsk@163.com
                            </td>
                            <td class="j5"><span class="green">等待代充值</span></td>
                            <td class="j6"><a href="#">取消</a></td>
                        </tr>
                        <tr class="hui">
                            <td class="j1">156151655</td>
                            <td class="j2">2012-12-12 12:25:23</td>
                            <td class="j3">150.00</td>
                            <td class="j4">
                                <p>支付宝</p>
                                supersdfsd@yahoo.com
                            </td>
                            <td class="j5"><span class="qx">已取消</span></td>
                            <td class="j6"><a href="#">删除</a></td>
                        </tr>
                        <tr>
                            <td class="j1">156151655</td>
                            <td class="j2">2012-12-12 12:25:23</td>
                            <td class="j3">100.00</td>
                            <td class="j4">
                                <p>支付宝</p>
                                kjsk@163.com
                            </td>
                            <td class="j5">
                                <span class="red">代充值失败</span>
                                <div class="reason">
                                    <div class="yy"><a href="#"><i></i>失败原因</a></div>
                                    <div class="reasonts">
                                        <i></i>您提供的支付宝帐号是空号！
                                    </div>
                                </div>
                                
                            </td>
                            <td class="j6"><a href="#">删除</a></td>
                        </tr>
                        <tr class="hui">
                            <td class="j1">156151655</td>
                            <td class="j2">2012-12-12 12:25:23</td>
                            <td class="j3">150.00</td>
                            <td class="j4">
                                <p>支付宝</p>
                                supersdfsd@yahoo.com
                            </td>
                            <td class="j5"><span>代充值成功</span></td>
                            <td class="j6"><a href="#">删除</a></td>
                        </tr>
                         -->
                    </table>
                </div>
                <?php }else{ ?>
                      <div class="jilunwu">
                	<p>您至今还没有代冲值记录！</p>
                </div>  
                        <?php } ?>
                 
                <div class="toolbar">
	                <?php echo $this->partial('paging.phtml',array('pages'=>$this->cardOrders)); ?>
                </div>
                
            </div>
            <div class="applyask">
                <div class="askname">
                    <h2>使用遇到的问题</h2>
                </div>
                <ul>
                    <li><a href="http://help.uuch.com/?p=142" target="_blank">1. 代充值申请成功后需要等待多久？</a></li>
                    <li><a href="http://help.uuch.com/?p=144" target="_blank">2. 为什么需要代冲值服务？</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>

<script language="javascript">
	function Cancel(id)
	{
		jQuery.ajax({
            type: "POST",
            url: "/member/list/",
            data: {"id":id,"type":1},	//1为取消
            dataType:"json",
            success: function(obj){
            	if(obj.ret == 1)
    			{
	    			window.location.href = "/member/list";
    			}
    			else
    			{
	    			switch(obj.ret)
	    			{
	    				case -1:
	    					alert("取消失败");
		    				break;
	    			}
    			}
            }
        });
	}

	function Delete(id)
	{
		jQuery.ajax({
            type: "POST",
            url: "/member/list/",
            data: {"id":id,"type":2},	//2为删除
            dataType:"json",
            success: function(obj){
            	if(obj.ret == 1)
    			{
	    			window.location.href = "/member/list";
    			}
    			else
    			{
	    			switch(obj.ret)
	    			{
	    				case -1:
	    					alert("取消失败");
		    				break;
	    			}
    			}
            }
        });
	}
</script>